<!--
  ~ MIT License
  ~
  ~ Copyright (c) 2021-2022 yangrunkang
  ~
  ~ Author: yangrunkang
  ~ Email: yangrunkang53@gmail.com
  ~
  ~ Permission is hereby granted, free of charge, to any person obtaining a copy
  ~ of this software and associated documentation files (the "Software"), to deal
  ~ in the Software without restriction, including without limitation the rights
  ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  ~ copies of the Software, and to permit persons to whom the Software is
  ~ furnished to do so, subject to the following conditions:
  ~
  ~ The above copyright notice and this permission notice shall be included in all
  ~ copies or substantial portions of the Software.
  ~
  ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  ~ SOFTWARE.
  -->

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      th:replace="index">
<!--css-->
<link th:fragment="css" type="text/css" rel="stylesheet" th:href="${ossStatic} + @{/css/common/img.css}"/>
<link th:fragment="css" type="text/css" rel="stylesheet" th:href="'/plugins/cherry/cherry-markdown.min.css?v='+${staticSourceVersion}"/>
<!---->
<script async="async" th:fragment="js" type="text/javascript" th:src="${ossStatic} + @{/js/comment/index.js}"></script>
<!--内容-->
<div th:fragment="content">
    <div class="container">
        <div class="row g-2">
            <div class="col-lg-9 mb-2">
                <div class="card border-0 rounded-3 p-2">
                    <div class="lead border-bottom mb-2">所有评论<small class="text-black-50 float-end">按时间倒序</small></div>
                    <div th:if="${#lists.isEmpty(commentIndexDto.commentDtoList)}">
                        <div th:include="fragments/index::empty_content"></div>
                    </div>
                    <div th:if="!${#lists.isEmpty(commentIndexDto.commentDtoList)}">
                        <ul class="list-group list-group-flush">
                            <li class="list-group-item p-2" th:each="commentDto,ite : ${commentIndexDto.commentDtoList}">
                                <article class="cherry-markdown" th:utext="${commentDto.commentContent}"></article>
                                <div>
                                    <a class="text-black-50 small"
                                       th:href="'/profile/' + ${commentDto.commentEnhance.memberEnhance.member.userId} + '/content'"
                                       th:title="${commentDto.commentEnhance.memberEnhance.member.userName}">
                                        <img th:data-src="${ossStatic} + @{/icons/system/comment-yellow.png}" class="lazyload cv-icon-small"/> 评论者&nbsp;&nbsp;<img  class="lazyload img rounded cv-icon-small"
                                                                                                th:data-src="${commentDto.commentEnhance.memberEnhance.member.via}"
                                                                                                th:alt="${commentDto.commentEnhance.memberEnhance.member.userName}" /> </i>
                                        <strong>[[${commentDto.commentEnhance.memberEnhance.member.userName}]]</strong>
                                    </a>
                                    <span class="text-black-50 small float-end"><img th:data-src="${ossStatic} + @{/icons/system/content-time.png}" class="lazyload cv-icon-small"/> <strong>[[${commentDto.commentEnhance.createDateDiff}]] <span th:include="fragments/comment::commentLatestAdd(${commentDto.commentEnhance.latestAdded},'近7天新增')"></span></strong></i></span>
                                </div>
                                <div>
                                    <a class="text-black-50 small"
                                       th:href="${commentDto.targetUrl}"
                                       th:title="${commentDto.targetTitle}">
                                        <i class="bi bi-link-45deg"> 来自于&nbsp;</i>
                                        <span class="badge rounded-3 fw-normal" style="border: 1px solid #DAEDE4;color: #3f7b5a;background-color: #EFF7ED;">[[${commentDto.sourceTag}]]</span> <strong>[[${commentDto.targetTitle}]]</strong>
                                    </a>
                                </div>
                            </li>
                        </ul>
                    </div>
                    <div th:replace="fragments/page::page(${commentIndexDto.pageDtoList})"></div>
                </div>
            </div>
            <div class="col-lg-3">
                <div th:include="fragments/index::global_search"></div>
                <!--全局个人信息卡片-->
                <div th:include="fragments/index::global_member_info"></div>
                <div th:replace="fragments/index::user_manage_fragment(true)"></div>
                <div th:include="fragments/index::google_right_ad"></div>
            </div>
        </div>
    </div>
</div>
</html>
